//
//  PushSetViewController.m
//  fitnessmanage
//
//  Created by wujian on 2017/12/15.
//  Copyright © 2017年 zongquankeji. All rights reserved.
//

#import "PushSetViewController.h"
#import "SignSetViewController.h"

@interface PushSetViewController ()

@property(nonatomic,strong)NSMutableArray *dataSource;

@property(nonatomic,weak)CommonBtnView *signView;

@end

@implementation PushSetViewController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    self.title = @"消息推送设置";
    
    self.view.backgroundColor = BackGroundColor;
    
    [self createSubView];
    
    [self loadVenueData];
}

-(void)createSubView{
    
    CommentSwitchView *balanceSwitch = [[CommentSwitchView alloc] init];
    balanceSwitch.titleLabel.text = @"会员卡余额不足通知";
    balanceSwitch.titleLabel.textColor = CSColorFromRGB(0x0a0a0a);
    [self.view addSubview:balanceSwitch];
    
    UILabel *noticeLabel = [[UILabel alloc] init];
    noticeLabel.text = @"您的名下会员收到提醒短信后，APP将同时发送系统通知给您。";
    noticeLabel.font = SmallFont;
    noticeLabel.textColor = CSColorFromRGB(0x999999);
    [self.view addSubview:noticeLabel];
    
    CommonBtnView *signView = [[CommonBtnView alloc] init];
    signView.titleLabel.text = @"签到/签出通知";
    signView.choseLabel.text = @"4家场馆通知";
    [signView.choseBtn addTarget:self action:@selector(signBtnClick)];
    signView.titleLabel.textColor = CSColorFromRGB(0x0a0a0a);
    [self.view addSubview:signView];
    self.signView = signView;

    
    [balanceSwitch mas_remakeConstraints:^(MASConstraintMaker *make) {
       
        make.top.mas_equalTo(self.view).offset(10);
        
        make.left.width.mas_equalTo(self.view);
    }];
    
    [noticeLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
       
        make.top.mas_equalTo(balanceSwitch.mas_bottom).offset(10);
        
        make.left.mas_equalTo(self.view).offset(10);
    }];
    
    [signView mas_remakeConstraints:^(MASConstraintMaker *make) {
       
        make.top.mas_equalTo(noticeLabel.mas_bottom).offset(25);
        
        make.left.width.mas_equalTo(self.view);
    }];
}

/**
 加载场馆数据
 */
-(void)loadVenueData{
    
    
//    BrandModel *brand = [BrandModel brand];
//    
//    NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
//    
//    [params setObject:brand.brandID forKey:@"brandID"];
//    
//    [HTTPTool GET:Get_Brand_Shop_List parameters:params
//     
//          success:^(id responseObject){
//              
//              [MBProgressHUD hideHUDForView:self.view];
//              
//              if (responseObject && [[responseObject objectForKey:@"Code"] intValue] == 0) {
//                  
//                  [self.dataSource removeAllObjects];
//                  
//                  self.dataSource = [NSMutableArray arrayWithArray:[responseObject objectForKey:@"ShopList"]];
//                  
//                  self.signView.choseLabel.text = [NSString stringWithFormat:@"%lu家场馆通知",(unsigned long)self.dataSource.count];
//              }
//              
//          }
//     
//          failure:^(NSError *error){
//              
//              [MBProgressHUD hideHUDForView:self.view];
//          }];
}

#pragma mark signBtnClick
-(void)signBtnClick{
    
    SignSetViewController *signSetVC = [[SignSetViewController alloc] init];
    
    signSetVC.dataSource = self.dataSource;
    
    [self.navigationController pushViewController:signSetVC animated:YES];
}

#pragma mark Get
-(NSMutableArray *)dataSource{
    
    if (!_dataSource) {
        
        _dataSource = [[NSMutableArray alloc] init];
    }
    
    return _dataSource;
}

@end
